package org.rency.ues.request;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.rency.ues.common.enums.EncryptType;

public class EncryptRequest {
	
	/**
	 * 密钥
	 */
	private String encryptKey;
	/**
	 * 密文
	 */
	private String encryptData;
	/**
	 * 加密方式
	 */
	private EncryptType encryptType = EncryptType.RSA;
	/**
	 * 有效时间(单位:秒,0:默认30天)
	 */
	private long expireTime = 0;
	/**
	 * 证书序列号
	 */
	private String serialNo;
	private long certVersion;
	
	public EncryptRequest(){}
	
	/**
	 * 解密
	 * @param ticket
	 * @param encryptType
	 * @param serialNo
	 */
	public EncryptRequest(String encryptKey,EncryptType encryptType,String serialNo){
		this.encryptKey = encryptKey;
		this.encryptType = encryptType;
		this.serialNo = serialNo;
	}
	
	public String getEncryptKey() {
		return encryptKey;
	}

	public void setEncryptKey(String encryptKey) {
		this.encryptKey = encryptKey;
	}

	public String getEncryptData() {
		return encryptData;
	}

	public void setEncryptData(String encryptData) {
		this.encryptData = encryptData;
	}

	public EncryptType getEncryptType() {
		return encryptType;
	}

	public void setEncryptType(EncryptType encryptType) {
		this.encryptType = encryptType;
	}

	public long getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(long expireTime) {
		this.expireTime = expireTime;
	}

	public String getSerialNo() {
		return serialNo;
	}

	public void setSerialNo(String serialNo) {
		this.serialNo = serialNo;
	}

	public long getCertVersion() {
		return certVersion;
	}

	public void setCertVersion(long certVersion) {
		this.certVersion = certVersion;
	}

	@Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
    }
	
}